package mobi.greenplate.theweb.converter;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import mobi.greenplate.theweb.domain.User;
//for : enum types (and many-to-one)
import mobi.greenplate.theweb.domain.UserRole;

import mobi.greenplate.theweb.domain.UserType;

@XmlRootElement(name = "user")
public class UserConverter {

    private final User entity;

    public UserConverter() {
        this.entity = new User();
    }

    public UserConverter(User entity) {
        this.entity = entity;
    }

    @XmlTransient
    public User getEntity() {
        return entity;
    }

    @XmlElement
    public Long getId() {
        return entity.getId();
    }

    public void setId(Long id) {
        entity.setId(id);
    }

    @XmlElement
    public String getUserName() {
        return entity.getUserName();
    }

    public void setUserName(String userName) {
        entity.setUserName(userName);
    }

    @XmlElement
    public String getPassword() {
        return entity.getPassword();
    }

    public void setPassword(String password) {
        entity.setPassword(password);
    }

    @XmlElement
    public UserType getType() {
        return entity.getType();
    }

    public void setType(UserType type) {
        entity.setType(type);
    }

    @XmlElement
    public UserRole getUserRole() {
        return entity.getUserRole();
    }

    public void setUserRole(UserRole role) {
        entity.setUserRole(role);
    }
}
